package com.java.mapper;

import com.java.entity.Capability;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CapabilityMapper {

    @Select("SELECT * FROM capability WHERE profile_id=#{profileId} ORDER BY sort ASC")
    List<Capability> selectByProfileId(Long profileId);

    @Insert("INSERT INTO capability(profile_id, name, description, unit, schema_json, sort) VALUES(#{profileId}, #{name}, #{description}, #{unit}, #{schemaJson}, #{sort})")
    int insert(Capability capability);

    @Delete("DELETE FROM capability WHERE profile_id=#{profileId}")
    int deleteByProfileId(Long profileId);
}